import Vue from 'vue'
import Vuex from 'vuex'
import user from "./user"

Vue.use(Vuex)


const state = {
    count: 1,
}

const mutations = {
    addCount(state, value) {
        state.count += +value
    }
}

const actions = {
    ADD_COUNT({ commit }, value) {
        commit("addCount", value)
    }
}
const getters = {
    getcount: (state) => {
        return state.count
    }
}

export default new Vuex.Store({
    state,
    getters,
    mutations,
    actions,
    modules: {
        user: user
    }
})